<div id="main_content" style="float:none;">
    <h3><?php echo $title; ?></h3>
    <a class="btn addEmoloyeeBack m10" href="<?php echo base_url();?>user"><?php echo $this->lang->line('User_Back'); ?></a>
    <div class="form_add">   
    <form action="" method="post">
       <table border="0" class="add_data">
        <tr>
            <td align="right">
                <label><?php echo $this->lang->line('User_FullName'); ?> <font color="#FF0000">(*)</font></label>
            </td>
            <td>
                <input type="text" name="txtFullName" size="50" value="<?php echo $txtFullName; ?>" maxlength="255">
                <span class="error"><?php echo form_error('txtFullName'); ?></span>
            </td>
        </tr>
        <?php if($cboLevel!=1){?>
       	<tr>
            <td align="right">
               <label><?php echo $this->lang->line('User_UserName'); ?> <font color="#FF0000">(*)</font></label>
            </td>
            <td>
                <input type="text" name="txtUserName" size="50" value="<?php echo $txtUserName; ?>" maxlength="50" />
                <span class="error"><?php echo form_error('txtUserName'); ?></span>
            </td>
        </tr>
        <?php } ?>
        <tr>
            <td align="right">
               <label><?php echo $this->lang->line('User_Pasword'); ?> <?php if($name_view=='add'){ ?><font color="#FF0000">(*)</font><?php } ?></label>
            </td>
            <td>
                <input type="password" name="txtPassword" size="20" value="<?php echo $txtPassword; ?>" maxlength="32" />
                <span class="error"><?php echo form_error('txtPassword'); ?></span>
            </td>
        </tr>
       	<tr>
            <td align="right">
                    <label><?php echo $this->lang->line('User_ConfimPasword'); ?><?php if($name_view=='add'){ ?> <font color="#FF0000">(*)</font><?php } ?></label>
            </td>
            <td>
                <input type="password" name="txtConfimPassword" size="20" value="<?php echo $txtConfimPassword; ?>" maxlength="32" />
                <span class="error"><?php echo form_error('txtConfimPassword'); ?></span>
            </td>
       </tr>
       <tr>
            <td align="right">
                <label><?php echo $this->lang->line('User_Email'); ?> <font color="#FF0000">(*)</font></label>
            </td>
            <td>
                <input type="text" name="txtEmail" size="50" value="<?php echo $txtEmail; ?>" maxlength="255" />
                <span class="error"><?php echo form_error('txtEmail'); ?></span>
            </td>
       </tr>
       <?php if($cboLevel!=1){?>
       <tr>
            <td align="right">
                <label><?php echo $this->lang->line('User_Manger'); ?> <font color="#FF0000">(*)</font></label>
            </td>
            <td>
                <select name="cboLevel" class="select_option">
                    <?php if($cboLevel!=1){?>
                    <option value="0" <?php if($cboLevel==0){echo "selected='selected'";}?>><?php echo $this->lang->line('User_All'); ?></option>
                    <option value="2" <?php if($cboLevel==2){echo "selected='selected'";}?>><?php echo $this->lang->line('User_HR'); ?></option>
                    <?php }else{ ?>
                    <option value="1" <?php if($cboLevel==1){echo "selected='selected'";}?>><?php echo $this->lang->line('User_Admin'); ?></option>
                    <?php } ?>
                </select>
                <span class="error"><?php echo form_error('cboLevel'); ?></span>
            </td>
      </tr>
      <?php if($this->uri->segment(2)=='add'){?>
      <tr>
        <td align="right">
            <label><?php echo $this->lang->line('User_DateCreate'); ?></label>
        </td>
        <td>
            <input type="text" name="txtDateCreate" maxlength="10" size="10" class="datepicker" value="<?php if(isset($txtDateCreate)){echo $txtDateCreate;} ?>" readonly="readonly" />
            <span class="error"><?php echo form_error('txtDateCreate'); ?></span>
        </td>
      </tr>
      <?php } ?>
      <tr>
        <td align="right">
           <label><?php echo $this->lang->line('User_Status'); ?> </label>
        </td>
        <td>
            <input type="checkbox" name="chkStatus" <?php if($chkStatus==1){echo "checked='checked'";} ?> value="1"> &nbsp;<label><?php echo $this->lang->line('User_Action'); ?> </label>
        </td>
      </tr>
      <?php } ?>
      <?php if($cboLevel!=1&&$this->uri->segment(2)=='edit'){?>
      <tr>
        <td align="right">
           <label><?php echo $this->lang->line('Us_Delete'); ?> </label>
        </td>
        <td>
            <input type="checkbox" name="chkDelFlag" <?php if($chkDelFlag==1){echo "checked='checked'";} ?> value="1">
        </td>
      </tr>
      <?php } ?>
      <tr>           
        <td align="left" colspan="2">
            <input type="hidden" name="id" value="<?php echo $idUser; ?>">
            <input type="submit" name="btnSubmit" value="<?php echo $this->lang->line('User_Submit'); ?>">
        </td>
      </tr>                                                                                         
       </table> 
    </form>
    </div>
</div>
<!-- BEGIN dialog message -->
<div id="dialog" title="<?php echo $this->lang->line('CR_dialog_title'); ?>">
    <?php echo isset($message) ? $message : ''; ?>
</div>
<!-- END dialog message -->
<script type="text/javascript">
    $(document).ready(function() {
<?php if (isset($flag) && $flag == TRUE): ?>
            $(function() {
                $("#dialog").dialog({
                    modal: true,
                    close: function() {
                        window.location.href = '<?php echo base_url('/user'); ?>';
                    },
                    buttons: [{
                        text: "<?php echo $this->lang->line('MC019');?>",
                        click: function() {
                            window.location.href = '<?php echo base_url('/user'); ?>';
                        },
                    }]
                });
            });
<?php elseif (isset($flag) && $flag == FALSE): ?>
            $(function() {
                $("#dialog").dialog({
                buttons: [
                    { text: "<?php echo $this->lang->line('MC019');?>", click: function() { $( this ).dialog( "close" ); } }
                ]
                });
            });
<?php endif; ?>
    });
</script>